package com.ciba.demo.controller;

import com.ciba.demo.respone.ApiRestResponse;
import com.ciba.demo.service.impl.WordServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
public class WordController {

    @Autowired
    WordServiceImpl wordService ;

    @ResponseBody
    @GetMapping("/reciteWordEnglishToChinese")
    public ApiRestResponse reciteWordEnglishToChinese(HttpServletRequest request, HttpServletResponse response){
        return wordService.getReciteWordEnglishToChinese(request,response) ;
    }


    @ResponseBody
    @GetMapping("/reciteWordChineseToEnglish")
    public ApiRestResponse reciteWordChineseToEnglish(HttpServletRequest request,HttpServletResponse response){
        return wordService.getReciteWordChineseToEnglish(request,response) ;
    }

    @ResponseBody
    @GetMapping("/reviewWordChineseToEnglish")
    public ApiRestResponse reviewWordChineseToEnglish(HttpServletRequest request,HttpServletResponse response){
        return wordService.getReviewWordChineseToEnglish(request,response) ;
    }


    @ResponseBody
    @GetMapping("/reviewWordEnglishToChinese")
    public ApiRestResponse reviewWordEnglishToChinese(HttpServletRequest request,HttpServletResponse response){
        return wordService.getReviewWordEnglishToChinese(request,response) ;
    }

    @ResponseBody
    @PostMapping("/report")
    public ApiRestResponse report(HttpServletRequest request,HttpServletResponse response){
        return wordService.report(request,response) ;
    }

}
